package com.caption.design.factory.method;

/**
 * 方法工厂模式
 * 1.手机可以电话
 * 2.苹果手机和华为手机都能打电话
 * 3.苹果手机由苹果工厂生产、华为手机由华为工厂生产
 */
public class TestMethodFactory {

    public static void main(String[] args) {
        AbstractPhoneFactory huaWeiPhoneFactory = new HuaWeiPhoneFactory();
        Phone huaWeiPhone = huaWeiPhoneFactory.createPhone();
        huaWeiPhone.callPhone();
        AbstractPhoneFactory appleFactory = new HuaWeiPhoneFactory();
        Phone applePhone = appleFactory.createPhone();
        applePhone.callPhone();
    }
}
